/**
 * Copyright (c) HANGZHOU JIXIN TECHNOLOGY Co., LTD.
 * TianTang Software Zoo, Hangzhou
 * All rights reserved.
 *
 * "[Description of code or deliverable as appropriate] is the copyrighted,
 * proprietary property of HANGZHOU JIXIN TECHNOLOGY Co., LTD. and its
 * subsidiaries and affiliates which retain all right and title."
 *
 * Revision History
 *
 * Date            Programmer              Notes
 * ---------    ---------------------  --------------------------------------------
 * 2016-6-3	       Zhao Lijun              Initial
 * 
 */

package com.jixin.pay.enums;

public enum PayWay {
	
	JD_PAY(1, "网银在线"),
	
	ALI_PAY(2, "支付宝");
	
	private int code;
	
	private String title;
	
	// 构造方法
    private PayWay(int code, String message) {
        this.code = code;
        this.title = message;
    }

    public static PayWay getPayWay(Integer code) {
    	if (code == null) {
    		return null;
    	}
    	for(PayWay type : PayWay.values()) {
    		if(type.getCode() == code) {
    			return type;
    		}
    	}
    	
    	return null;
    }
    
	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String message) {
		this.title = message;
	}
    
}
